package com.papper.common.enums;

/**
 * @Author:Lajiao
 * @Date:2014年7月14日
 * @Time:下午3:49:44
 * @Description:数据状态定义
 */
public enum OrgTypeEnum {
    L10("L10", "公司账户", 30000),
    L20("L20", "公司业务员", 30000),
    L30("L30", "办事处", 30000),
    L31("L31", "一级代理", 299),
    L32("L32", "特约代理", 99),
    L33("L33", "经销商", 99),
    L40("L40", "通道外放", 99),
    L90("L90", "基础签约商户", 3000);

    private String  code;
    private String  name;
    private Integer price;

    OrgTypeEnum(String code, String name, Integer price) {
        this.code = code;
        this.name = name;
        this.price = price;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getPrice() {
        return price;
    }

    public void setPrice(Integer price) {
        this.price = price;
    }

    public static String getName(String code) {
        if (code == null) {
            return "";
        }
        for (OrgTypeEnum re : OrgTypeEnum.values()) {
            if (re.getCode().equals(code)) {
                return re.getName();
            }
        }
        return "";
    }

    public static String getCode(String name) {
        if (name == null) {
            return null;
        }
        for (OrgTypeEnum re : OrgTypeEnum.values()) {
            if (name.equals(re.getName())) {
                return re.getCode();
            }
        }
        return null;
    }
}
